<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>IP白名单</title>
	<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style-1.css" />
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css" />>
	<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
	<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
	<script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
    <style>
    	.w560{width: 560px;}
    </style>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current="menu_ipwhite">
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/>
					<#include "/include/wxtop.html"/>
					<div class="content">
						<form method="post" id="form" action="${basePath}/admin/ipwhite/persis">
							<div class="msgWrap form">
								<table class="userinfoArea" border="0" cellSpacing="0" cellPadding="0" width="100%">
									<tbody>
										<tr>
											<th style="width: 120px" valign="top"><span class="red">*</span><label for="keyword">起始IP：</label></th>
											<td>
												<input type="text" class="px" maxlength="100" name="beginIp" id="bengin_ip" value="${bean.beginIp!}" placeholder="输入起始IP"/>
											</td>
										</tr>
										<tr>
											<th style="width: 120px" valign="top"><span class="red">*</span><label for="keyword">结束IP：</label></th>
											<td>
												<input type="text" class="px" maxlength="100" name="endIp" id="end_ip" value="${bean.endIp!}" placeholder="输入结束IP"/>
											</td>
										</tr>
										<tr>
											<th style="width: 120px" valign="top"><label for="keyword">描述：</label></th>
											<td>
												<input type="text" class="px" maxlength="100" name="description" value="${bean.description!}" placeholder="请输入描述"/>
											</td>
										</tr>
										<tr>
											<th><label for="title">谁否有效：</label></th>
											<td>
												<select name="isValid">
													<option value="1" <#if bean.isValid == 1>selected</#if>>启用</option>
													<option value="0" <#if bean.isValid == 0>selected</#if>>停用</option>
												</select>
											</td>
										</tr>
										<tr>
											<th></th>
											<td>
												<input type="hidden" name="id" value="${bean.id!}" />
												<input type="button" value="保存" class="btnGreen left" onclick="checkFrom();"/>&nbsp;&nbsp;
											    <a href="${basePath}/admin/ipwhite/index" class="btnGray vm">返回</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</form>
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<#include "/include/footer.html"/>
	
<script type="text/javascript">

function checkFrom(){
	//ip正则
	var ipReg = /^((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))$/;
	
	var bengin_ip = $("#bengin_ip").val();
	var end_ip = $("#end_ip").val();
	
	
	if(bengin_ip==""||!ipReg.test(bengin_ip)){
		layer.tips('IP地址不规范', '#bengin_ip');
		return false;
	}
	
	if(end_ip==""||!ipReg.test(end_ip)){
		layer.tips('IP地址不规范', '#end_ip');
		return false;
	}
	
	$("#form").submit();
}
</script>
</body>
</html>